The present invention relates generally to frequency modulation (FM) synthesis, and, more particularly, to a method and system for generating audio waveforms used in FM music sound synthesis.
The reproduction of common waveforms in general, and of instrument sounds in particular, requires a collection of the primary components of that sound that when appropriately processed, can create a replica of that sound. The most accurate but impractical method would be a recording of that sound that includes all of its variants in frequency, attack, etc. Practical methods reduce the set of parameters needed to reproduce the sound. In the case of wavetable synthesis, each instrument is recorded and sampled over a small number of pitch cycles, over a subset of octaves. These sampled recordings are stored in a wavetable, and reproduction of the sound involves looping over this table.
FM synthesis replicates instrument sounds and therefore can be used as a synthesizer in music reproduction. Compared to the other methods of music generation, FM synthesis requires the least amount of memory for the music reproduction process while still maintaining an acceptable integrity of the instrument sound. It requires substantially less ROM and/or RAM memory for this synthesis method since it needs only a small set of pre-defined waveforms stored as a set of look-up wavetables. Wavetable synthesis, on the other hand, requires a much greater amount of memory in order to achieve an acceptable level of performance. In an example case where FM synthesis requires about 24 KB of instrument synthesis data comprising of the waveform tables, wave shaping data, and the wavetable synthesizer would require at least 512 KB of wavetable memory. This is a factor of 21 times the data size requirement for FM synthesis.
Besides the distinctive amplitude envelopes of sound produced from an instrument, sidetones create the timbre that distinguishes one instrument sound from another. Since sidetones are a naturally occurring and analytically derivable effect from performing frequency modulation on predefined waveforms, audio FM synthesis can be used to simulate instrument sounds. This is accomplished by matching the sidetones of the FM synthesized waveforms with the real instrument sidetones. A most basic FM synthesis tone generator uses a modulator frequency for self-modulation and to modulate a carrier frequency.
FIG. 1 illustrates a block diagram of this basic FM synthesis tone generator 100. The FM synthesis tone generator 100 uses a frequency of a modulator 102 to perform self-modulation (103) and to modulate a frequency of a carrier 104. A waveform wavetable index, φm[n], is calculated from the sum of the modulator frequency,
      2    ⁢                  ⁢    π    ⁢                  ⁢                            f          m                          f          s                    ⁡              [        n        ]              ,and a portion of the modulator signal, βr[n−1]. The waveform wavetable index is then used with a waveform look-up wavetable 106 to generate the first sequence of output samples W1[n]. A gain factor (Am[n]) is applied to this output resulting in r[n], where r[n]=Am[n]W1[n]. The delayed portion of this signal, βr[n−1], is then fed back to the modulator to calculate the next sample's modulator wavetable index. The amount fed back is determined by a gain factor (β), representing the modulator's frequency deviation. A portion of modulator signal, αr[n], is also fed forward to modulate the carrier frequency after a carrier gain factor, α, is applied. The carrier frequency,
      2    ⁢                  ⁢    π    ⁢                  ⁢                            f          c                          f          s                    ⁡              [        n        ]              ,is summed with αr[n] resulting in the wavetable index, φc[n]. This value is used with a wavetable 108 to yield the second sequence of output samples, W2[n]. A carrier gain factor, (Ac[n]), is then applied to obtain the final simulated instrument sound, SFM[n], where SFM[n]=Ac[n]W2[n]. Using this type of synthesis requires only a few waveform wavetables. For example, six waveform tables may be used to reproduce all of the 128 General MIDI instruments and 47 General MIDI drums.
FM synthesis may be chosen as the tone generator for music reproduction because of the economical benefits resulting from a smaller wavetable size requirement. This small set of waveforms placed in look-up wavetables would need substantially less ROM and/or RAM memory for this synthesis method.
In one implementation, the look-up waveform wavetables contain a complete cycle of all the necessary waveforms. The software algorithm computes a wavetable step index calculated from the carrier and modulator frequencies. This step index is accumulated and used to acquire each sample of the carrier and modulator waveforms from the appropriate wavetable. A simple wrapping algorithm (cycle-modulo arithmetic) is used to reproduce the continuous stream of the waveform. This single-cycle wrapping algorithm requires the minimum number of instruction cycles needed to recreate the carrier and modulator waveforms.
In another implementation, the symmetry of the waveforms can be used to reduce the memory size significantly since only part of a cycle (e.g., ¼ of a cycle or ½ of a cycle) of one of the waveforms is needed to generate all of the waveforms. Complex waveforms can be further created through segmentation of the cycle stored. This requires a more complex software wavetable look-up algorithm. The segments of the accumulated wavetable index has to be calculated, modulo arithmetic over the reduced cycle and full cycle needs to be performed, shifting of the index has to be done to adjust the step size, and a segment modification wavetable has to be used to scale the waveform within a segment.
However, the conventional wavetable look-up algorithm used today for FM synthesis systems experiences several drawbacks. For the aforementioned first implementation, a larger size memory device may be required since a full cycle of the waveform is stored. As such, when more wavetables are needed to be stored, a bigger memory device is needed. A large memory device can consume a larger physical area, thus increasing the die size, cost, and the power consumption of the chip. The access time to a large memory device is also higher than a small memory device, and it is also possible for timing violations to occur. A problem with timing violations is typically very costly to repair.
For the aforementioned second implementation that takes advantage of the symmetry and similarity of the waveform cycles, a smaller memory device is needed at the expense of an increase in instruction cycle usage. The increase is significant, and is doubled in FM synthesis since the wavetables are accessed twice per sample, once for the modulator frequency and once for the carrier frequency.
Therefore, it is desirable to implement a wavetable look-up algorithm that can reduce the memory size as well as the processor load.